package Temp.杂乱无章;

import java.util.Scanner;

public class 折纸 {
    public static void main(String[] args) {
        int lon = 1189;
        int width = 841;
        Scanner scanner = new Scanner(System.in);
        String paperName = scanner.nextLine();
        //paperName.substring(1) 是将输入的纸张名称从第二个字符开始截取，得到的结果就是纸张的编号（例如 “1”、“2” 等）
        //Integer.parseInt() 函数将这个编号字符串转换为整数
        int paperNumber = Integer.parseInt(paperName.substring(1));
        for (int i = 0; i < paperNumber; i++) {
            int temp = lon;
            lon = width;
            width = temp / 2;
        }
        System.out.println(lon);
        System.out.println(width);

    }
}
